package com.gonsin.gview.common.auth.session;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpSession;

public class JwtSessionWrapper extends HttpServletRequestWrapper {

//    private HttpServletRequest httpServletRequest;
//    private HttpServletResponse httpServletResponse;
    //自定义Session
    private HttpSession session;

    public JwtSessionWrapper(HttpServletRequest request, String token, String secret){
        super(request);
        this.session = new JwtHttpSession(token, secret);
    }

    //这个方法就是最重要的，通过它获取自定义的 HttpSession
    @Override
    public HttpSession getSession() {
        return this.session;
    }
}
